<template>
	<view class="box" v-if="search.style">
		<view class="input" :class="[search.style.searchStyle,search.style.textAlign]">
			<icon class="icon" type="search" size="16"/>
			<text class="placeholder">{{search.params.placeholder || '搜索商品'}}</text>
		</view>
	</view>
</template>

<script>
import { mapState } from 'vuex';
	export default {
		name:"my-search",
		data() {
			return {
			};
		},
		created(){
		},
		computed:{
			...mapState('home',['search']),
		},
		methods:{
		}
	}
</script>

<style lang="scss" scoped>
.box{
	background-color: #f1f1f2;
	padding: 20rpx;
	font-size: 26rpx;
	.input{
		background-color: #fff;
		width: 100%;
		height: 60rpx;
		&.radius{
			border-radius: 15rpx;
		}
		&.square{
			border-radius: 0;
		}
		&.round{
			border-radius: 30rpx;
		}
		
		&.left{
			text-align-last: left;
		}
		&.center{
			text-align: center;
		}
		&.right{
			text-align: right;
		}
		// padding-left: 15rpx;
		.icon{
			margin-left: 15rpx;
			line-height: 60rpx;
			lighting-color: 60rpx;
		}
		.placeholder{
			color:#666;
			vertical-align: bottom;
			line-height: 60rpx;
			margin-left: 10rpx;
			
		}
	}
}
</style>